/*****************************************************************************
 * alignstubs.h: stubs for functions that require an aligned stack
 *****************************************************************************
 * Copyright (C) 2012 x264 project
 *
 * Authors: Juergen Bohl <jbohl@jbohl.de>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111, USA.
 *
 * This program is also available under a commercial proprietary license.
 * For more information, contact us at licensing@x264.com.
 *****************************************************************************/

#ifndef X264_ALIGNSTUBS_H
#define X264_ALIGNSTUBS_H

#if ARCH_X86

int x264_alignstubbed_intra_satd_x9_4x4_avx( uint8_t * a, uint8_t * b, uint16_t * c);
int x264_alignstubbed_intra_sad_x9_4x4_avx( uint8_t *, uint8_t *, uint16_t * );
int x264_alignstubbed_intra_sad_x9_8x8_avx   ( uint8_t *, uint8_t *, uint8_t *, uint16_t *, uint16_t * );

uint64_t x264_alignstubbed_pixel_hadamard_ac_16x16_sse2( pixel *pix, intptr_t i_stride );
uint64_t x264_alignstubbed_pixel_hadamard_ac_16x8_sse2( pixel *pix, intptr_t i_stride );
uint64_t x264_alignstubbed_pixel_hadamard_ac_8x16_sse2( pixel *pix, intptr_t i_stride );
uint64_t x264_alignstubbed_pixel_hadamard_ac_8x8_sse2( pixel *pix, intptr_t i_stride );

uint64_t x264_alignstubbed_pixel_hadamard_ac_16x16_ssse3( pixel *pix, intptr_t i_stride );
uint64_t x264_alignstubbed_pixel_hadamard_ac_16x8_ssse3( pixel *pix, intptr_t i_stride );
uint64_t x264_alignstubbed_pixel_hadamard_ac_8x16_ssse3( pixel *pix, intptr_t i_stride );
uint64_t x264_alignstubbed_pixel_hadamard_ac_8x8_ssse3( pixel *pix, intptr_t i_stride );

uint64_t x264_alignstubbed_pixel_hadamard_ac_16x16_sse4( pixel *pix, intptr_t i_stride );
uint64_t x264_alignstubbed_pixel_hadamard_ac_16x8_sse4( pixel *pix, intptr_t i_stride );
uint64_t x264_alignstubbed_pixel_hadamard_ac_8x16_sse4( pixel *pix, intptr_t i_stride );
uint64_t x264_alignstubbed_pixel_hadamard_ac_8x8_sse4( pixel *pix, intptr_t i_stride );

uint64_t x264_alignstubbed_pixel_hadamard_ac_16x16_avx( pixel *pix, intptr_t i_stride );
uint64_t x264_alignstubbed_pixel_hadamard_ac_16x8_avx( pixel *pix, intptr_t i_stride );
uint64_t x264_alignstubbed_pixel_hadamard_ac_8x16_avx( pixel *pix, intptr_t i_stride );
uint64_t x264_alignstubbed_pixel_hadamard_ac_8x8_avx( pixel *pix, intptr_t i_stride );

uint64_t x264_alignstubbed_pixel_hadamard_ac_16x16_xop( pixel *pix, intptr_t i_stride );
uint64_t x264_alignstubbed_pixel_hadamard_ac_16x8_xop( pixel *pix, intptr_t i_stride );
uint64_t x264_alignstubbed_pixel_hadamard_ac_8x16_xop( pixel *pix, intptr_t i_stride );
uint64_t x264_alignstubbed_pixel_hadamard_ac_8x8_xop( pixel *pix, intptr_t i_stride );

void x264_alignstubbed_mc_chroma_sse2( pixel *dstu, pixel *dstv, intptr_t i_dst, pixel *src, intptr_t i_src, int dx, int dy, int i_width, int i_height );
void x264_alignstubbed_mc_chroma_sse2_misalign( pixel *dstu, pixel *dstv, intptr_t i_dst, pixel *src, intptr_t i_src, int dx, int dy, int i_width, int i_height );
void x264_alignstubbed_mc_chroma_ssse3( pixel *dstu, pixel *dstv, intptr_t i_dst, pixel *src, intptr_t i_src, int dx, int dy, int i_width, int i_height );
void x264_alignstubbed_mc_chroma_ssse3_cache64( pixel *dstu, pixel *dstv, intptr_t i_dst, pixel *src, intptr_t i_src, int dx, int dy, int i_width, int i_height );
void x264_alignstubbed_mc_chroma_avx( pixel *dstu, pixel *dstv, intptr_t i_dst, pixel *src, intptr_t i_src, int dx, int dy, int i_width, int i_height );

void x264_alignstubbed_deblock_v_luma_avx ( pixel *pix, intptr_t stride, int alpha, int beta, int8_t *tc0 );
void x264_alignstubbed_deblock_h_luma_avx ( pixel *pix, intptr_t stride, int alpha, int beta, int8_t *tc0 );
void x264_alignstubbed_deblock_v_chroma_avx ( pixel *pix, intptr_t stride, int alpha, int beta, int8_t *tc0 );
void x264_alignstubbed_deblock_v_luma_intra_avx ( pixel *pix, intptr_t stride, int alpha, int beta );
void x264_alignstubbed_deblock_h_luma_intra_avx ( pixel *pix, intptr_t stride, int alpha, int beta );
void x264_alignstubbed_deblock_v_chroma_intra_avx ( pixel *pix, intptr_t stride, int alpha, int beta );
void x264_alignstubbed_deblock_h_chroma_intra_avx ( pixel *pix, intptr_t stride, int alpha, int beta );
void x264_alignstubbed_deblock_h_chroma_mbaff_avx ( pixel *pix, intptr_t stride, int alpha, int beta, int8_t *tc0 );
void x264_alignstubbed_deblock_h_chroma_intra_mbaff_avx ( pixel *pix, intptr_t stride, int alpha, int beta );

void x264_alignstubbed_deblock_v_luma_sse2( pixel *pix, intptr_t stride, int alpha, int beta, int8_t *tc0 );
void x264_alignstubbed_deblock_h_luma_sse2( pixel *pix, intptr_t stride, int alpha, int beta, int8_t *tc0 );
void x264_alignstubbed_deblock_v_chroma_sse2( pixel *pix, intptr_t stride, int alpha, int beta, int8_t *tc0 );
void x264_alignstubbed_deblock_v_luma_intra_sse2( pixel *pix, intptr_t stride, int alpha, int beta );
void x264_alignstubbed_deblock_h_luma_intra_sse2( pixel *pix, intptr_t stride, int alpha, int beta );
void x264_alignstubbed_deblock_v_chroma_intra_sse2( pixel *pix, intptr_t stride, int alpha, int beta );
void x264_alignstubbed_deblock_h_chroma_intra_sse2( pixel *pix, intptr_t stride, int alpha, int beta );

int x264_alignstubbed_intra_sad_x9_4x4_ssse3 ( uint8_t *, uint8_t *, uint16_t * );
int x264_alignstubbed_intra_satd_x9_4x4_ssse3( uint8_t *, uint8_t *, uint16_t * );
int x264_alignstubbed_intra_sad_x9_8x8_ssse3 ( uint8_t *, uint8_t *, uint8_t *, uint16_t *, uint16_t * );

int x264_alignstubbed_intra_sad_x9_4x4_sse4 ( uint8_t *, uint8_t *, uint16_t * );
int x264_alignstubbed_intra_satd_x9_4x4_sse4( uint8_t *, uint8_t *, uint16_t * );
int x264_alignstubbed_intra_sad_x9_8x8_sse4 ( uint8_t *, uint8_t *, uint8_t *, uint16_t *, uint16_t * );

int x264_alignstubbed_intra_sad_x9_4x4_xop ( uint8_t *, uint8_t *, uint16_t * );
int x264_alignstubbed_intra_satd_x9_4x4_xop( uint8_t *, uint8_t *, uint16_t * );
int x264_alignstubbed_intra_sad_x9_8x8_xop ( uint8_t *, uint8_t *, uint8_t *, uint16_t *, uint16_t * );
int x264_alignstubbed_intra_satd_x9_4x4_xop  ( uint8_t *, uint8_t *, uint16_t * );

void x264_alignstubbed_deblock_h_chroma_intra_mbaff_sse2( pixel *pix, intptr_t stride, int alpha, int beta );

#endif

#endif
